﻿using System;
using UnityEngine;
using UnityEngine.UI;

namespace H
{
	// Token: 0x02000211 RID: 529
	internal class AreaEcho
	{
		// Token: 0x06000E82 RID: 3714 RVA: 0x0005AC28 File Offset: 0x00058E28
		public AreaEcho(Image image, RectTransform area)
		{
			this.echoImg = image;
			this.area = area;
			this.show = false;
			this.echoImg.enabled = false;
		}

		// Token: 0x17000175 RID: 373
		// (get) Token: 0x06000E83 RID: 3715 RVA: 0x0005AC68 File Offset: 0x00058E68
		// (set) Token: 0x06000E84 RID: 3716 RVA: 0x0005AC70 File Offset: 0x00058E70
		public bool show { get; private set; }

		// Token: 0x06000E85 RID: 3717 RVA: 0x0005AC7C File Offset: 0x00058E7C
		public void Set(Vector2 pos)
		{
			this.show = true;
			this.rate = 0f;
			this.echoImg.rectTransform.anchoredPosition = pos;
			this.echoImg.enabled = true;
		}

		// Token: 0x06000E86 RID: 3718 RVA: 0x0005ACB0 File Offset: 0x00058EB0
		public void Update()
		{
			if (this.show)
			{
				this.rate += Time.deltaTime * this.speed;
				if (this.rate >= 1f)
				{
					this.show = false;
					this.echoImg.enabled = false;
				}
				float d = this.maxSize * this.rate;
				this.echoImg.rectTransform.sizeDelta = Vector2.one * d;
				Color color = this.echoImg.color;
				color.a = 1f - this.rate;
				this.echoImg.color = color;
			}
		}

		// Token: 0x04000EF1 RID: 3825
		private Image echoImg;

		// Token: 0x04000EF2 RID: 3826
		private RectTransform area;

		// Token: 0x04000EF3 RID: 3827
		private float rate;

		// Token: 0x04000EF4 RID: 3828
		private float maxSize = 200f;

		// Token: 0x04000EF5 RID: 3829
		private float speed = 0.5f;
	}
}
